package bavaria.hightech.testit;

import bavaria.hightech.banking.account.AccountType;
import bavaria.hightech.banking.bank.AccountNotFoundException;
import bavaria.hightech.banking.bank.BankImpl;
import bavaria.hightech.banking.bank.Currency;
import bavaria.hightech.banking.bank.Money;
import bavaria.hightech.banking.condition.ContractPeriod;

public class TestBank {

	public static void main(String[] args) throws AccountNotFoundException {
		BankImpl bank = new BankImpl();
		bank.newAccount("Heinz", AccountType.GIRO, null);
		bank.newAccount("Karl", AccountType.FIXED_DEPOSIT,
				ContractPeriod.ONE_YEAR);
		bank.list();
		bank.deposit(1000, new Money(2000, Currency.EURO), "gehalt");
		bank.deposit(1001, new Money(40, Currency.EURO), "hartz4");
		bank.chargeInterest();
		try {
			bank.drawout(1000, new Money(3000, Currency.EURO),
					"steuerhinterziehung");
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			bank.drawout(1001, new Money(200, Currency.EURO), "tv gekauft");
		} catch (Exception e) {
			e.printStackTrace();
		}
		bank.chargeInterest();
		bank.list();
	}
}
